package com.hualan.controller;

import com.hualan.domain.Teacherlevel;
import com.hualan.service.TeacherlevelService;
import com.hualan.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/teacherlevel")
public class TeacherlevelController {
    @Autowired
    public TeacherlevelService teacherlevelService;

    @GetMapping("/selectTeacherLevel")
    public R selectTeacherAndlevel(String level){
        List<Teacherlevel> teacherlevels = teacherlevelService.selectTeacherAndlevel(level);
        if (teacherlevels.size()>0){
            return R.success(teacherlevels);
        }else {
            return R.fail(teacherlevels);
        }
    }


}
